#ifndef COIN_HPP
#define COIN_HPP
/**
 * @file   coin.hpp
 * @author Kimmo Luoma <kimmo@PHOTON3>
 * @date   Fri Sep 28 09:50:48 2012
 * 
 * @brief  Template class for coin operator. Coin operator \f$ C \f$ is a unitary 
 * operator in \f$ d \f$-dimensional Hilbert space. One implementation  
 * is DFT coin
 * 
 * Natural basis is \f$ \vert j \rangle \f$. Components of j are \f$ \sum_d j_d \delta_{j,d} \f$.
 *  
 */

#include <boost/numeric/ublas/matrix.hpp>
#include <complex>
#include "gen_op.hpp"

using namespace boost::numeric::ublas;

namespace QuantumWalk{
  
  template <typename T> class coin:public gen_op{
    typedef gen_op::ptr_t ptr_t;
  private:
    matrix<T> c_;
  public:
    /** 
     * Constructor
     * 
     */
    coin():gen_op(){};
    
    /** 
     * Constructor
     * 
     * @param c Coin matrix \f$ C \f$
     */
    coin(const matrix<T>& c,int D,int V);
    
    /** 
     * Set coin matrix
     * 
     * @param c 
     */
    void set_op(const matrix<T>& c);
    /** 
     * Get coin matrix
     * 
     * 
     * @return 
     */
    matrix<T> get_op();
    /** 
     * Copu constructor
     * 
     * @param C 
     */
    coin(const coin& C);
    /** 
     * Copy assignment
     * 
     * @param C 
     * 
     * @return reference to coin class
     */
    coin& operator=(const coin& C);
    /** 
     * Get element of coin matrix
     * 
     * 
     * @return object type T
     */
    T operator()(int i,int j) const;
    
    int get_dim() const;
    
    virtual ptr_t pointer();
    
    matrix<T> asmatrix();
  
  };
};
#endif
